package com.qeegoo.b2bautozityp.moudle.order;

//┏┓　　　┏┓ 
//┏┛┻━━━┛┻┓ 
//┃　　　　　　　┃ 　 
//┃　　　━　　　┃ 
//┃　┳┛　┗┳　┃ 
//┃　　　　　　　┃ 
//┃　　　┻　　　┃ 
//┃　　　　　　　┃ 
//┗━┓　　　┏━┛ 
//┃　　　┃  神兽保佑　　　　　　　　 
//┃　　　┃  代码无BUG！ 
//┃　　　┗━━━┓ 
//┃　　　　　　　┣┓ 
//┃　　　　　　　┏┛ 
//┗┓┓┏━┳┓┏┛ 
// ┃┫┫　┃┫┫ 
// ┗┻┛　┗┻┛

import com.qeegoo.b2bautozityp.moudle.order.model.OrderChildItem;
import com.qeegoo.b2bautozityp.moudle.order.model.OrderFooterItem;
import com.qeegoo.b2bautozityp.moudle.order.model.OrderHeaderItem;
import com.qeegoo.b2bautozityp.moudle.order.model.OrderResultBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lk on 2017/9/14.
 */

public class OrderDataHelper {


    public static List<Object> handleOriginDatas(List<OrderResultBean.OrderListBean> originList,String orderType){
        List<Object> dataList = new ArrayList<Object>();
        int i = 0;
        for (OrderResultBean.OrderListBean orderItemBean : originList){
            OrderHeaderItem orderHeaderItem = new OrderHeaderItem();
            OrderFooterItem orderFooterItem = new OrderFooterItem();

            orderHeaderItem.itemContent = orderItemBean;
            orderFooterItem.itemContent = orderItemBean;
            orderFooterItem.realPosition = i;
            orderFooterItem.orderType = orderType;
            orderHeaderItem.realPosition = i;
            dataList.add(orderHeaderItem);
            if (orderItemBean.orders != null){
                for (OrderResultBean.Orderben childOrderItemBean :orderItemBean.orders){
                    OrderChildItem orderChildItem = new OrderChildItem();
                    orderChildItem.itemContent= childOrderItemBean;
                    orderChildItem.realPosition= i;
                    dataList.add(orderChildItem);
                }
            }
            dataList.add(orderFooterItem);
            i++;
        }



        return dataList;

    }
}
